<template>
  <div class="app">
     <Header></Header>
    <!-- 导航区 -->
    <div class="navigate">
      <!-- to 属性， active-class 属性  -->
      <RouterLink to="/home" active-class="active">首页</RouterLink>
      <!-- <RouterLink to="/news" active-class="active">新闻</RouterLink> -->
      <RouterLink :to="{name:'news'}" active-class="active">新闻</RouterLink>
      <!-- <RouterLink to="/about" active-class="active">关于</RouterLink> -->
      <RouterLink :to="{ path: '/about' }" active-class="active">关于</RouterLink>
    </div>
    <!-- 展示区 -->
    <div class="main-content">
      <!-- 以后就放在这里  路由器视图-->
      <RouterView></RouterView>
    </div>
  </div>
  <!-- 
   RouterLink 组件
    to 属性：指定路由路径  有两种写法 1. 字符串写法 2. 对象写法 {path: '/about'} 3. 对象写法通过名称 {name: 'about'}
    active-class 属性：指定选中时的类名，默认值为 router-link-active
    exact-active-class 属性：指定完全匹配时的类名，默认值为 router-link-exact-active
    
   -->
</template>

<script lang="ts" setup name="App">
import { RouterView, RouterLink } from 'vue-router'
import Header from './components/Header.vue';

</script>

<style>
/* App */

.navigate {
  display: flex;
  justify-content: space-around;
  margin: 0 100px;
}

.navigate a {
  display: block;
  text-align: center;
  width: 90px;
  height: 40px;
  line-height: 40px;
  border-radius: 10px;
  background-color: gray;
  text-decoration: none;
  color: white;
  font-size: 18px;
  letter-spacing: 5px;
}



.navigate a.active {
  background-color: #64967E;
  color: #ffc268;
  font-weight: 900;
  /* text-shadow: 0 0 1px black; */
  font-family: 微软雅黑;
}

.navigate a:hover {
  background-color: #ffc268;
  color: #64967E;
  font-weight: 900;
  /* 向上移动4px */
  transform: translateY(-4px);
  transition: all 0.3s;
  font-family: 微软雅黑;
}


.main-content {
  margin: 0 auto;
  margin-top: 30px;
  border-radius: 10px;
  width: 100%;
  height: 400px;
  border: 1px solid;
}
</style>
